home *** CD-ROM | disk | FTP | other *** search
/ Champak 122 / Vol 122.iso / games / super_cr.swf / scripts / DefineSprite_264 / frame_1 / DoAction.as
Encoding:
Text File  |  2011-01-06  |  492 b   |  26 lines

  1. counter = 0;
  2. stop();
  3. onEnterFrame = function()
  4. {
  5.    counter++;
  6.    if(counter > 100 / _parent.playerSpeed)
  7.    {
  8.       counter = 0;
  9.       if(_currentframe != _totalframes)
  10.       {
  11.          if(_parent.playerSpeed > 100)
  12.          {
  13.             gotoAndStop(_currentframe + Math.round(_parent.playerSpeed / 100));
  14.          }
  15.          else
  16.          {
  17.             gotoAndStop(_currentframe + 1);
  18.          }
  19.       }
  20.       else
  21.       {
  22.          gotoAndStop(1);
  23.       }
  24.    }
  25. };
  26.